library(tidyverse)
library(plotly)
library(readxl)
# set the working directory
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
Read in the data from the Excel file
land = readxl::read_xlsx("Crop_Range_GOES0901_CountJday.xlsx")
Show the histogram
# histogram
plot_ly(land, x = ~FDCount,nbinsx = 10) %>%
filter(jday %in% 233) %>%
add_histogram(marker = list(color = "teal",line = list(color = "darkgray", width = 2)),
name = "Julian Day = 233") %>%
layout(title="FDCount Histogram at Julian Day 233",
yaxis=list(title = "Count"),
xaxis=list(title = "FDCount")) %>%
layout(showlegend = TRUE)
Another way
# Another way
plot_ly(land, x = ~FDCount,nbinsx = 10, type= "histogram") %>% filter(jday %in% 233) %>%
layout(title="FDCount Histogram at Julian Day 233",
yaxis=list(title = "Count"),
xaxis=list(title = "FDCount")) %>%
layout(showlegend = TRUE)